package com.alinesno.cloud.busines.demo.gateway.dto;


import com.alinesno.cloud.common.facade.dto.BaseDto;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * 功能名： 课程
 * 数据表：  learn_course
 * @author wh ${authorEmail}
 * @date 2021-09-06 22:52:32
 */
public class LearnCourseDto extends BaseDto {
    private static final long serialVersionUID = 1L;
    // fields
        /**
         *  "courseNumber"
         */
        private String courseNumber;
        /**
         *  "courseName"
         */
        private String courseName;
        /**
         *  "teacherId"
         */
        private String teacherId;
        /**
         *  "classId"
         */
        private String classId;
    //getter and setter
        public String getCourseNumber()

        {
            return this.courseNumber;
        }

        public LearnCourseDto setCourseNumber(String arg) {
            this.courseNumber = arg;
            return this;
        }
        public String getCourseName()

        {
            return this.courseName;
        }

        public LearnCourseDto setCourseName(String arg) {
            this.courseName = arg;
            return this;
        }
        public String getTeacherId()

        {
            return this.teacherId;
        }

        public LearnCourseDto setTeacherId(String arg) {
            this.teacherId = arg;
            return this;
        }
        public String getClassId()

        {
            return this.classId;
        }

        public LearnCourseDto setClassId(String arg) {
            this.classId = arg;
            return this;
        }

    /**
    * 快速从 dto 转换成 entity
    * @return  dto 对应的 entity
    */
    public LearnCourseDto mapToDto() {
        ObjectMapper toDtoMapper = new ObjectMapper();
        toDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return toDtoMapper.convertValue(this,LearnCourseDto.class);
    }

    /**
    * 快速从 entity 转换成 dto
    * @return  dto 对应的 entity
    */
    public LearnCourseDto fromDto(LearnCourseDto entity) {
        ObjectMapper fromDtoMapper = new ObjectMapper();
        fromDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return fromDtoMapper.convertValue(entity,LearnCourseDto.class);
    }

}
